/*
 * XML Type:  EPackage
 * Namespace: http://www.eclipse.org/emf/2002/Ecore
 * Java type: org.eclipse.emf.x2002.ecore.EPackage
 *
 * Automatically generated - do not modify.
 */
package org.eclipse.emf.x2002.ecore.impl;
/**
 * An XML EPackage(@http://www.eclipse.org/emf/2002/Ecore).
 *
 * This is a complex type.
 */
public class EPackageImpl extends org.eclipse.emf.x2002.ecore.impl.ENamedElementImpl implements org.eclipse.emf.x2002.ecore.EPackage
{
    private static final long serialVersionUID = 1L;
    
    public EPackageImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName ECLASSIFIERS$0 = 
        new javax.xml.namespace.QName("", "eClassifiers");
    private static final javax.xml.namespace.QName ESUBPACKAGES$2 = 
        new javax.xml.namespace.QName("", "eSubpackages");
    private static final javax.xml.namespace.QName NSURI$4 = 
        new javax.xml.namespace.QName("", "nsURI");
    private static final javax.xml.namespace.QName NSPREFIX$6 = 
        new javax.xml.namespace.QName("", "nsPrefix");
    private static final javax.xml.namespace.QName EFACTORYINSTANCE$8 = 
        new javax.xml.namespace.QName("", "eFactoryInstance");
    
    
    /**
     * Gets array of all "eClassifiers" elements
     */
    public org.eclipse.emf.x2002.ecore.EClassifier[] getEClassifiersArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ECLASSIFIERS$0, targetList);
            org.eclipse.emf.x2002.ecore.EClassifier[] result = new org.eclipse.emf.x2002.ecore.EClassifier[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "eClassifiers" element
     */
    public org.eclipse.emf.x2002.ecore.EClassifier getEClassifiersArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EClassifier target = null;
            target = (org.eclipse.emf.x2002.ecore.EClassifier)get_store().find_element_user(ECLASSIFIERS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "eClassifiers" element
     */
    public int sizeOfEClassifiersArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ECLASSIFIERS$0);
        }
    }
    
    /**
     * Sets array of all "eClassifiers" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setEClassifiersArray(org.eclipse.emf.x2002.ecore.EClassifier[] eClassifiersArray)
    {
        check_orphaned();
        arraySetterHelper(eClassifiersArray, ECLASSIFIERS$0);
    }
    
    /**
     * Sets ith "eClassifiers" element
     */
    public void setEClassifiersArray(int i, org.eclipse.emf.x2002.ecore.EClassifier eClassifiers)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EClassifier target = null;
            target = (org.eclipse.emf.x2002.ecore.EClassifier)get_store().find_element_user(ECLASSIFIERS$0, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(eClassifiers);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "eClassifiers" element
     */
    public org.eclipse.emf.x2002.ecore.EClassifier insertNewEClassifiers(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EClassifier target = null;
            target = (org.eclipse.emf.x2002.ecore.EClassifier)get_store().insert_element_user(ECLASSIFIERS$0, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "eClassifiers" element
     */
    public org.eclipse.emf.x2002.ecore.EClassifier addNewEClassifiers()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EClassifier target = null;
            target = (org.eclipse.emf.x2002.ecore.EClassifier)get_store().add_element_user(ECLASSIFIERS$0);
            return target;
        }
    }
    
    /**
     * Removes the ith "eClassifiers" element
     */
    public void removeEClassifiers(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ECLASSIFIERS$0, i);
        }
    }
    
    /**
     * Gets array of all "eSubpackages" elements
     */
    public org.eclipse.emf.x2002.ecore.EPackage[] getESubpackagesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(ESUBPACKAGES$2, targetList);
            org.eclipse.emf.x2002.ecore.EPackage[] result = new org.eclipse.emf.x2002.ecore.EPackage[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "eSubpackages" element
     */
    public org.eclipse.emf.x2002.ecore.EPackage getESubpackagesArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EPackage target = null;
            target = (org.eclipse.emf.x2002.ecore.EPackage)get_store().find_element_user(ESUBPACKAGES$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "eSubpackages" element
     */
    public int sizeOfESubpackagesArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ESUBPACKAGES$2);
        }
    }
    
    /**
     * Sets array of all "eSubpackages" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setESubpackagesArray(org.eclipse.emf.x2002.ecore.EPackage[] eSubpackagesArray)
    {
        check_orphaned();
        arraySetterHelper(eSubpackagesArray, ESUBPACKAGES$2);
    }
    
    /**
     * Sets ith "eSubpackages" element
     */
    public void setESubpackagesArray(int i, org.eclipse.emf.x2002.ecore.EPackage eSubpackages)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EPackage target = null;
            target = (org.eclipse.emf.x2002.ecore.EPackage)get_store().find_element_user(ESUBPACKAGES$2, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(eSubpackages);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "eSubpackages" element
     */
    public org.eclipse.emf.x2002.ecore.EPackage insertNewESubpackages(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EPackage target = null;
            target = (org.eclipse.emf.x2002.ecore.EPackage)get_store().insert_element_user(ESUBPACKAGES$2, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "eSubpackages" element
     */
    public org.eclipse.emf.x2002.ecore.EPackage addNewESubpackages()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EPackage target = null;
            target = (org.eclipse.emf.x2002.ecore.EPackage)get_store().add_element_user(ESUBPACKAGES$2);
            return target;
        }
    }
    
    /**
     * Removes the ith "eSubpackages" element
     */
    public void removeESubpackages(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ESUBPACKAGES$2, i);
        }
    }
    
    /**
     * Gets the "nsURI" attribute
     */
    public java.lang.String getNsURI()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NSURI$4);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "nsURI" attribute
     */
    public org.eclipse.emf.x2002.ecore.EString xgetNsURI()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EString target = null;
            target = (org.eclipse.emf.x2002.ecore.EString)get_store().find_attribute_user(NSURI$4);
            return target;
        }
    }
    
    /**
     * True if has "nsURI" attribute
     */
    public boolean isSetNsURI()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(NSURI$4) != null;
        }
    }
    
    /**
     * Sets the "nsURI" attribute
     */
    public void setNsURI(java.lang.String nsURI)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NSURI$4);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NSURI$4);
            }
            target.setStringValue(nsURI);
        }
    }
    
    /**
     * Sets (as xml) the "nsURI" attribute
     */
    public void xsetNsURI(org.eclipse.emf.x2002.ecore.EString nsURI)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EString target = null;
            target = (org.eclipse.emf.x2002.ecore.EString)get_store().find_attribute_user(NSURI$4);
            if (target == null)
            {
                target = (org.eclipse.emf.x2002.ecore.EString)get_store().add_attribute_user(NSURI$4);
            }
            target.set(nsURI);
        }
    }
    
    /**
     * Unsets the "nsURI" attribute
     */
    public void unsetNsURI()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(NSURI$4);
        }
    }
    
    /**
     * Gets the "nsPrefix" attribute
     */
    public java.lang.String getNsPrefix()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NSPREFIX$6);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "nsPrefix" attribute
     */
    public org.eclipse.emf.x2002.ecore.EString xgetNsPrefix()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EString target = null;
            target = (org.eclipse.emf.x2002.ecore.EString)get_store().find_attribute_user(NSPREFIX$6);
            return target;
        }
    }
    
    /**
     * True if has "nsPrefix" attribute
     */
    public boolean isSetNsPrefix()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(NSPREFIX$6) != null;
        }
    }
    
    /**
     * Sets the "nsPrefix" attribute
     */
    public void setNsPrefix(java.lang.String nsPrefix)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(NSPREFIX$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(NSPREFIX$6);
            }
            target.setStringValue(nsPrefix);
        }
    }
    
    /**
     * Sets (as xml) the "nsPrefix" attribute
     */
    public void xsetNsPrefix(org.eclipse.emf.x2002.ecore.EString nsPrefix)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.eclipse.emf.x2002.ecore.EString target = null;
            target = (org.eclipse.emf.x2002.ecore.EString)get_store().find_attribute_user(NSPREFIX$6);
            if (target == null)
            {
                target = (org.eclipse.emf.x2002.ecore.EString)get_store().add_attribute_user(NSPREFIX$6);
            }
            target.set(nsPrefix);
        }
    }
    
    /**
     * Unsets the "nsPrefix" attribute
     */
    public void unsetNsPrefix()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(NSPREFIX$6);
        }
    }
    
    /**
     * Gets the "eFactoryInstance" attribute
     */
    public java.lang.String getEFactoryInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(EFACTORYINSTANCE$8);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "eFactoryInstance" attribute
     */
    public org.apache.xmlbeans.XmlIDREF xgetEFactoryInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlIDREF target = null;
            target = (org.apache.xmlbeans.XmlIDREF)get_store().find_attribute_user(EFACTORYINSTANCE$8);
            return target;
        }
    }
    
    /**
     * True if has "eFactoryInstance" attribute
     */
    public boolean isSetEFactoryInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(EFACTORYINSTANCE$8) != null;
        }
    }
    
    /**
     * Sets the "eFactoryInstance" attribute
     */
    public void setEFactoryInstance(java.lang.String eFactoryInstance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(EFACTORYINSTANCE$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(EFACTORYINSTANCE$8);
            }
            target.setStringValue(eFactoryInstance);
        }
    }
    
    /**
     * Sets (as xml) the "eFactoryInstance" attribute
     */
    public void xsetEFactoryInstance(org.apache.xmlbeans.XmlIDREF eFactoryInstance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlIDREF target = null;
            target = (org.apache.xmlbeans.XmlIDREF)get_store().find_attribute_user(EFACTORYINSTANCE$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlIDREF)get_store().add_attribute_user(EFACTORYINSTANCE$8);
            }
            target.set(eFactoryInstance);
        }
    }
    
    /**
     * Unsets the "eFactoryInstance" attribute
     */
    public void unsetEFactoryInstance()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(EFACTORYINSTANCE$8);
        }
    }
}
